package com.example.demo.mapper;
import com.example.demo.model.Teacher;
import org.apache.ibatis.annotations.*;
import java.util.List;
@Mapper
public interface TeacherMapper {
    @Select("select * from teacher")
    List<Teacher> findAll();

    @Select("select * from teacher where tel = #{tel}")
    List<Teacher> findByTel(String tel);

    @Select("select * from teacher where id = #{id}")
    Teacher get(Integer id);

    @Delete("delete from teacher where id = #{id}")
    void delete(Integer id);

    @Insert("insert into teacher(id, name, tel,age) values(#{id}, #{name}, #{tel},#{age})")
    void save(Teacher teacher);

    @Update("update teacher set name = #{name}, tel = #{tel}, age=#{age} where id = #{id}")
    void update(Teacher teacher);
    //@Select("select * from teacher where name = #{name} and tel = #{tel}")
    List<Teacher> search(Teacher teacher);

}
